<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<div class="pageContent">
    <form method="post" action="article/save" onsubmit="return iframeCallback(this, navTabAjaxDone);"class="pageForm required-validate" enctype="multipart/form-data">
        <div class="pageFormContent" layoutH="56">
            <p>
                <label>标题：</label>
                <input name="articleTitle" class="required" type="text" size="30"  alt="请输入标题名称"/>
            </p>
            <p>
                <label>文章类型：</label>
                <select id="type" name="fourType.typeId" onchange="haha();">
                    <option value=""  selected="select">请选择:</option>
                    <option value="1" >家居风水</option>
                    <option value="2" >装修日记</option>
                    <option value="3" >巧装美家</option>
                    <option value="4" >乐购攻略</option>
                    <option value="5" >行业新闻</option>
                </select>
            </p>
            <p>
                <label>head：</label>
                <input type="text" readonly="readonly" id="articleHead" name="articleHead">
            </p>
            <p>
                <label>文章小标题：</label>
                <input type="text" value="" name="articleSmallTitle" class="textInput">
            </p>
            <p >
                <label>上传图片：</label>
                <input name="photo" class="required" type="file" size="30"/>
            </p>
            <p></p>
            <p>
                <label>上传文章内容：</label><br/><br/>
                <textarea  class="ckeditor"  name="fourContent.content"></textarea>
            </p>

            <script type="text/javascript">
                CKEDITOR.replace('fourContent.content');
            </script>

        </div>
        <div class="formBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent"><button type="submit">上传</button></div></div></li>
                <li>
                    <div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
                </li>
            </ul>
        </div>
    </form>
</div>
<script>
    function haha(){
        if ($("#type  option:selected").val()==1) {
            $("#articleHead").attr("value","【美乐乐家居风水知识】阳宅风水大师坐镇-最新家居风水布局-各类卧室风水禁忌")
            return;
        } else if($("#type  option:selected").val()==2) {
            $("#articleHead").attr("value","【装修日记】最新装修日记资讯-装修日记效果图片分享-美乐乐装修日记频道")
            return;
        }else if($("#type  option:selected").val()==3) {
            $("#articleHead").attr("value","【巧装美家】室内装修方法,室内装饰步骤-美乐乐巧装美家频道")
            return;
        }else if($("#type  option:selected").val()==4) {
            $("#articleHead").attr("value","【乐购攻略】家居商品购买技巧,最实惠价格尽在—美乐乐乐购攻略频道")
            return;
        }else if($("#type  option:selected").val()==5) {
            $("#articleHead").attr("value","【行业新闻】家居新闻资讯动态中心-美乐乐行业新闻频道")
            return;
        }else{
            alert("请选择一个类型")
            return;
        }
    }
</script>